Integrand size = 36, antiderivative size = 840 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {i (e+f x)^2}{a d}-\frac {(e+f x)^3}{3 a f}-\frac {\left (a^2-b^2\right ) (e+f x)^3}{3 a b^2 f}+\frac {2 b (e+f x)^2 \text {arctanh}\left (e^{i (c+d x)}\right )}{a^2 d}+\frac {2 b f^2 \cos (c+d x)}{a^2 d^3}+\frac {2 \left (a^2-b^2\right ) f^2 \cos (c+d x)}{a^2 b d^3}-\frac {b (e+f x)^2 \cos (c+d x)}{a^2 d}-\frac {\left (a^2-b^2\right ) (e+f x)^2 \cos (c+d x)}{a^2 b d}-\frac {(e+f x)^2 \cot (c+d x)}{a d}-\frac {i \left (a^2-b^2\right )^{3/2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {i \left (a^2-b^2\right )^{3/2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {2 f (e+f x) \log \left (1-e^{2 i (c+d x)}\right )}{a d^2}-\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a^2 d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{a^2 d^2}-\frac {2 \left (a^2-b^2\right )^{3/2} f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^2}+\frac {2 \left (a^2-b^2\right )^{3/2} f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^2}-\frac {i f^2 \operatorname {PolyLog}\left (2,e^{2 i (c+d x)}\right )}{a d^3}+\frac {2 b f^2 \operatorname {PolyLog}\left (3,-e^{i (c+d x)}\right )}{a^2 d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,e^{i (c+d x)}\right )}{a^2 d^3}-\frac {2 i \left (a^2-b^2\right )^{3/2} f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^3}+\frac {2 i \left (a^2-b^2\right )^{3/2} f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^3}+\frac {2 b f (e+f x) \sin (c+d x)}{a^2 d^2}+\frac {2 \left (a^2-b^2\right ) f (e+f x) \sin (c+d x)}{a^2 b d^2} \]
[Out]
Time = 1.44 (sec) , antiderivative size = 840, normalized size of antiderivative = 1.00, number of steps used = 53, number of rules used = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.611, Rules used = {4639, 4493, 3392, 32, 2715, 8, 3801, 3798, 2221, 2317, 2438, 4490, 3391, 3377, 2718, 4268, 2611, 2320, 6724, 4621, 3404, 2296} \[ \int \frac {(e+f x)^2 \cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=-\frac {\left (a^2-b^2\right ) (e+f x)^3}{3 a b^2 f}-\frac {(e+f x)^3}{3 a f}+\frac {2 b \text {arctanh}\left (e^{i (c+d x)}\right ) (e+f x)^2}{a^2 d}-\frac {b \cos (c+d x) (e+f x)^2}{a^2 d}-\frac {\left (a^2-b^2\right ) \cos (c+d x) (e+f x)^2}{a^2 b d}-\frac {\cot (c+d x) (e+f x)^2}{a d}-\frac {i \left (a^2-b^2\right )^{3/2} \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right ) (e+f x)^2}{a^2 b^2 d}+\frac {i \left (a^2-b^2\right )^{3/2} \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right ) (e+f x)^2}{a^2 b^2 d}-\frac {i (e+f x)^2}{a d}+\frac {2 f \log \left (1-e^{2 i (c+d x)}\right ) (e+f x)}{a d^2}-\frac {2 i b f \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right ) (e+f x)}{a^2 d^2}+\frac {2 i b f \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right ) (e+f x)}{a^2 d^2}-\frac {2 \left (a^2-b^2\right )^{3/2} f \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right ) (e+f x)}{a^2 b^2 d^2}+\frac {2 \left (a^2-b^2\right )^{3/2} f \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right ) (e+f x)}{a^2 b^2 d^2}+\frac {2 b f \sin (c+d x) (e+f x)}{a^2 d^2}+\frac {2 \left (a^2-b^2\right ) f \sin (c+d x) (e+f x)}{a^2 b d^2}+\frac {2 b f^2 \cos (c+d x)}{a^2 d^3}+\frac {2 \left (a^2-b^2\right ) f^2 \cos (c+d x)}{a^2 b d^3}-\frac {i f^2 \operatorname {PolyLog}\left (2,e^{2 i (c+d x)}\right )}{a d^3}+\frac {2 b f^2 \operatorname {PolyLog}\left (3,-e^{i (c+d x)}\right )}{a^2 d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,e^{i (c+d x)}\right )}{a^2 d^3}-\frac {2 i \left (a^2-b^2\right )^{3/2} f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^3}+\frac {2 i \left (a^2-b^2\right )^{3/2} f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^3} \]
[In]
[Out]
Rule 8
Rule 32
Rule 2221
Rule 2296
Rule 2317
Rule 2320
Rule 2438
Rule 2611
Rule 2715
Rule 2718
Rule 3377
Rule 3391
Rule 3392
Rule 3404
Rule 3798
Rule 3801
Rule 4268
Rule 4490
Rule 4493
Rule 4621
Rule 4639
Rule 6724
Rubi steps \begin{align*} \text {integral}& = \frac {\int (e+f x)^2 \cos ^2(c+d x) \cot ^2(c+d x) \, dx}{a}-\frac {b \int \frac {(e+f x)^2 \cos ^3(c+d x) \cot (c+d x)}{a+b \sin (c+d x)} \, dx}{a} \\ & = -\frac {\int (e+f x)^2 \cos ^2(c+d x) \, dx}{a}+\frac {\int (e+f x)^2 \cot ^2(c+d x) \, dx}{a}-\frac {b \int (e+f x)^2 \cos ^3(c+d x) \cot (c+d x) \, dx}{a^2}+\frac {b^2 \int \frac {(e+f x)^2 \cos ^4(c+d x)}{a+b \sin (c+d x)} \, dx}{a^2} \\ & = -\frac {f (e+f x) \cos ^2(c+d x)}{2 a d^2}-\frac {(e+f x)^2 \cot (c+d x)}{a d}-\frac {(e+f x)^2 \cos (c+d x) \sin (c+d x)}{2 a d}-\frac {\int (e+f x)^2 \, dx}{2 a}-\frac {\int (e+f x)^2 \, dx}{a}+\frac {\int (e+f x)^2 \cos ^2(c+d x) \, dx}{a}-\frac {b \int (e+f x)^2 \cos (c+d x) \cot (c+d x) \, dx}{a^2}-\left (1-\frac {b^2}{a^2}\right ) \int \frac {(e+f x)^2 \cos ^2(c+d x)}{a+b \sin (c+d x)} \, dx+\frac {(2 f) \int (e+f x) \cot (c+d x) \, dx}{a d}+\frac {f^2 \int \cos ^2(c+d x) \, dx}{2 a d^2} \\ & = -\frac {i (e+f x)^2}{a d}-\frac {(e+f x)^3}{2 a f}-\frac {(e+f x)^2 \cot (c+d x)}{a d}+\frac {f^2 \cos (c+d x) \sin (c+d x)}{4 a d^3}+\frac {\int (e+f x)^2 \, dx}{2 a}-\frac {b \int (e+f x)^2 \csc (c+d x) \, dx}{a^2}+\frac {b \int (e+f x)^2 \sin (c+d x) \, dx}{a^2}-\frac {\left (a \left (1-\frac {b^2}{a^2}\right )\right ) \int (e+f x)^2 \, dx}{b^2}-\frac {\left (-1+\frac {b^2}{a^2}\right ) \int (e+f x)^2 \sin (c+d x) \, dx}{b}-\frac {\left (\left (a^2-b^2\right ) \left (-1+\frac {b^2}{a^2}\right )\right ) \int \frac {(e+f x)^2}{a+b \sin (c+d x)} \, dx}{b^2}-\frac {(4 i f) \int \frac {e^{2 i (c+d x)} (e+f x)}{1-e^{2 i (c+d x)}} \, dx}{a d}+\frac {f^2 \int 1 \, dx}{4 a d^2}-\frac {f^2 \int \cos ^2(c+d x) \, dx}{2 a d^2} \\ & = \frac {f^2 x}{4 a d^2}-\frac {i (e+f x)^2}{a d}-\frac {(e+f x)^3}{3 a f}-\frac {a \left (1-\frac {b^2}{a^2}\right ) (e+f x)^3}{3 b^2 f}+\frac {2 b (e+f x)^2 \text {arctanh}\left (e^{i (c+d x)}\right )}{a^2 d}-\frac {b (e+f x)^2 \cos (c+d x)}{a^2 d}-\frac {\left (1-\frac {b^2}{a^2}\right ) (e+f x)^2 \cos (c+d x)}{b d}-\frac {(e+f x)^2 \cot (c+d x)}{a d}+\frac {2 f (e+f x) \log \left (1-e^{2 i (c+d x)}\right )}{a d^2}+\frac {\left (2 \left (a^2-b^2\right )^2\right ) \int \frac {e^{i (c+d x)} (e+f x)^2}{i b+2 a e^{i (c+d x)}-i b e^{2 i (c+d x)}} \, dx}{a^2 b^2}+\frac {(2 b f) \int (e+f x) \cos (c+d x) \, dx}{a^2 d}+\frac {(2 b f) \int (e+f x) \log \left (1-e^{i (c+d x)}\right ) \, dx}{a^2 d}-\frac {(2 b f) \int (e+f x) \log \left (1+e^{i (c+d x)}\right ) \, dx}{a^2 d}+\frac {\left (2 \left (1-\frac {b^2}{a^2}\right ) f\right ) \int (e+f x) \cos (c+d x) \, dx}{b d}-\frac {f^2 \int 1 \, dx}{4 a d^2}-\frac {\left (2 f^2\right ) \int \log \left (1-e^{2 i (c+d x)}\right ) \, dx}{a d^2} \\ & = -\frac {i (e+f x)^2}{a d}-\frac {(e+f x)^3}{3 a f}-\frac {a \left (1-\frac {b^2}{a^2}\right ) (e+f x)^3}{3 b^2 f}+\frac {2 b (e+f x)^2 \text {arctanh}\left (e^{i (c+d x)}\right )}{a^2 d}-\frac {b (e+f x)^2 \cos (c+d x)}{a^2 d}-\frac {\left (1-\frac {b^2}{a^2}\right ) (e+f x)^2 \cos (c+d x)}{b d}-\frac {(e+f x)^2 \cot (c+d x)}{a d}+\frac {2 f (e+f x) \log \left (1-e^{2 i (c+d x)}\right )}{a d^2}-\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a^2 d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{a^2 d^2}+\frac {2 b f (e+f x) \sin (c+d x)}{a^2 d^2}+\frac {2 \left (1-\frac {b^2}{a^2}\right ) f (e+f x) \sin (c+d x)}{b d^2}-\frac {\left (2 i \left (a^2-b^2\right )^{3/2}\right ) \int \frac {e^{i (c+d x)} (e+f x)^2}{2 a-2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{a^2 b}+\frac {\left (2 i \left (a^2-b^2\right )^{3/2}\right ) \int \frac {e^{i (c+d x)} (e+f x)^2}{2 a+2 \sqrt {a^2-b^2}-2 i b e^{i (c+d x)}} \, dx}{a^2 b}+\frac {\left (i f^2\right ) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{2 i (c+d x)}\right )}{a d^3}+\frac {\left (2 i b f^2\right ) \int \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right ) \, dx}{a^2 d^2}-\frac {\left (2 i b f^2\right ) \int \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right ) \, dx}{a^2 d^2}-\frac {\left (2 b f^2\right ) \int \sin (c+d x) \, dx}{a^2 d^2}-\frac {\left (2 \left (1-\frac {b^2}{a^2}\right ) f^2\right ) \int \sin (c+d x) \, dx}{b d^2} \\ & = -\frac {i (e+f x)^2}{a d}-\frac {(e+f x)^3}{3 a f}-\frac {a \left (1-\frac {b^2}{a^2}\right ) (e+f x)^3}{3 b^2 f}+\frac {2 b (e+f x)^2 \text {arctanh}\left (e^{i (c+d x)}\right )}{a^2 d}+\frac {2 b f^2 \cos (c+d x)}{a^2 d^3}+\frac {2 \left (1-\frac {b^2}{a^2}\right ) f^2 \cos (c+d x)}{b d^3}-\frac {b (e+f x)^2 \cos (c+d x)}{a^2 d}-\frac {\left (1-\frac {b^2}{a^2}\right ) (e+f x)^2 \cos (c+d x)}{b d}-\frac {(e+f x)^2 \cot (c+d x)}{a d}-\frac {i \left (a^2-b^2\right )^{3/2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {i \left (a^2-b^2\right )^{3/2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {2 f (e+f x) \log \left (1-e^{2 i (c+d x)}\right )}{a d^2}-\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a^2 d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{a^2 d^2}-\frac {i f^2 \operatorname {PolyLog}\left (2,e^{2 i (c+d x)}\right )}{a d^3}+\frac {2 b f (e+f x) \sin (c+d x)}{a^2 d^2}+\frac {2 \left (1-\frac {b^2}{a^2}\right ) f (e+f x) \sin (c+d x)}{b d^2}+\frac {\left (2 i \left (a^2-b^2\right )^{3/2} f\right ) \int (e+f x) \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{a^2 b^2 d}-\frac {\left (2 i \left (a^2-b^2\right )^{3/2} f\right ) \int (e+f x) \log \left (1-\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{a^2 b^2 d}+\frac {\left (2 b f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a^2 d^3}-\frac {\left (2 b f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,x)}{x} \, dx,x,e^{i (c+d x)}\right )}{a^2 d^3} \\ & = -\frac {i (e+f x)^2}{a d}-\frac {(e+f x)^3}{3 a f}-\frac {a \left (1-\frac {b^2}{a^2}\right ) (e+f x)^3}{3 b^2 f}+\frac {2 b (e+f x)^2 \text {arctanh}\left (e^{i (c+d x)}\right )}{a^2 d}+\frac {2 b f^2 \cos (c+d x)}{a^2 d^3}+\frac {2 \left (1-\frac {b^2}{a^2}\right ) f^2 \cos (c+d x)}{b d^3}-\frac {b (e+f x)^2 \cos (c+d x)}{a^2 d}-\frac {\left (1-\frac {b^2}{a^2}\right ) (e+f x)^2 \cos (c+d x)}{b d}-\frac {(e+f x)^2 \cot (c+d x)}{a d}-\frac {i \left (a^2-b^2\right )^{3/2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {i \left (a^2-b^2\right )^{3/2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {2 f (e+f x) \log \left (1-e^{2 i (c+d x)}\right )}{a d^2}-\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a^2 d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{a^2 d^2}-\frac {2 \left (a^2-b^2\right )^{3/2} f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^2}+\frac {2 \left (a^2-b^2\right )^{3/2} f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^2}-\frac {i f^2 \operatorname {PolyLog}\left (2,e^{2 i (c+d x)}\right )}{a d^3}+\frac {2 b f^2 \operatorname {PolyLog}\left (3,-e^{i (c+d x)}\right )}{a^2 d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,e^{i (c+d x)}\right )}{a^2 d^3}+\frac {2 b f (e+f x) \sin (c+d x)}{a^2 d^2}+\frac {2 \left (1-\frac {b^2}{a^2}\right ) f (e+f x) \sin (c+d x)}{b d^2}+\frac {\left (2 \left (a^2-b^2\right )^{3/2} f^2\right ) \int \operatorname {PolyLog}\left (2,\frac {2 i b e^{i (c+d x)}}{2 a-2 \sqrt {a^2-b^2}}\right ) \, dx}{a^2 b^2 d^2}-\frac {\left (2 \left (a^2-b^2\right )^{3/2} f^2\right ) \int \operatorname {PolyLog}\left (2,\frac {2 i b e^{i (c+d x)}}{2 a+2 \sqrt {a^2-b^2}}\right ) \, dx}{a^2 b^2 d^2} \\ & = -\frac {i (e+f x)^2}{a d}-\frac {(e+f x)^3}{3 a f}-\frac {a \left (1-\frac {b^2}{a^2}\right ) (e+f x)^3}{3 b^2 f}+\frac {2 b (e+f x)^2 \text {arctanh}\left (e^{i (c+d x)}\right )}{a^2 d}+\frac {2 b f^2 \cos (c+d x)}{a^2 d^3}+\frac {2 \left (1-\frac {b^2}{a^2}\right ) f^2 \cos (c+d x)}{b d^3}-\frac {b (e+f x)^2 \cos (c+d x)}{a^2 d}-\frac {\left (1-\frac {b^2}{a^2}\right ) (e+f x)^2 \cos (c+d x)}{b d}-\frac {(e+f x)^2 \cot (c+d x)}{a d}-\frac {i \left (a^2-b^2\right )^{3/2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {i \left (a^2-b^2\right )^{3/2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {2 f (e+f x) \log \left (1-e^{2 i (c+d x)}\right )}{a d^2}-\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a^2 d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{a^2 d^2}-\frac {2 \left (a^2-b^2\right )^{3/2} f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^2}+\frac {2 \left (a^2-b^2\right )^{3/2} f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^2}-\frac {i f^2 \operatorname {PolyLog}\left (2,e^{2 i (c+d x)}\right )}{a d^3}+\frac {2 b f^2 \operatorname {PolyLog}\left (3,-e^{i (c+d x)}\right )}{a^2 d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,e^{i (c+d x)}\right )}{a^2 d^3}+\frac {2 b f (e+f x) \sin (c+d x)}{a^2 d^2}+\frac {2 \left (1-\frac {b^2}{a^2}\right ) f (e+f x) \sin (c+d x)}{b d^2}-\frac {\left (2 i \left (a^2-b^2\right )^{3/2} f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}\left (2,\frac {i b x}{a-\sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{a^2 b^2 d^3}+\frac {\left (2 i \left (a^2-b^2\right )^{3/2} f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}\left (2,\frac {i b x}{a+\sqrt {a^2-b^2}}\right )}{x} \, dx,x,e^{i (c+d x)}\right )}{a^2 b^2 d^3} \\ & = -\frac {i (e+f x)^2}{a d}-\frac {(e+f x)^3}{3 a f}-\frac {a \left (1-\frac {b^2}{a^2}\right ) (e+f x)^3}{3 b^2 f}+\frac {2 b (e+f x)^2 \text {arctanh}\left (e^{i (c+d x)}\right )}{a^2 d}+\frac {2 b f^2 \cos (c+d x)}{a^2 d^3}+\frac {2 \left (1-\frac {b^2}{a^2}\right ) f^2 \cos (c+d x)}{b d^3}-\frac {b (e+f x)^2 \cos (c+d x)}{a^2 d}-\frac {\left (1-\frac {b^2}{a^2}\right ) (e+f x)^2 \cos (c+d x)}{b d}-\frac {(e+f x)^2 \cot (c+d x)}{a d}-\frac {i \left (a^2-b^2\right )^{3/2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {i \left (a^2-b^2\right )^{3/2} (e+f x)^2 \log \left (1-\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d}+\frac {2 f (e+f x) \log \left (1-e^{2 i (c+d x)}\right )}{a d^2}-\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,-e^{i (c+d x)}\right )}{a^2 d^2}+\frac {2 i b f (e+f x) \operatorname {PolyLog}\left (2,e^{i (c+d x)}\right )}{a^2 d^2}-\frac {2 \left (a^2-b^2\right )^{3/2} f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^2}+\frac {2 \left (a^2-b^2\right )^{3/2} f (e+f x) \operatorname {PolyLog}\left (2,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^2}-\frac {i f^2 \operatorname {PolyLog}\left (2,e^{2 i (c+d x)}\right )}{a d^3}+\frac {2 b f^2 \operatorname {PolyLog}\left (3,-e^{i (c+d x)}\right )}{a^2 d^3}-\frac {2 b f^2 \operatorname {PolyLog}\left (3,e^{i (c+d x)}\right )}{a^2 d^3}-\frac {2 i \left (a^2-b^2\right )^{3/2} f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a-\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^3}+\frac {2 i \left (a^2-b^2\right )^{3/2} f^2 \operatorname {PolyLog}\left (3,\frac {i b e^{i (c+d x)}}{a+\sqrt {a^2-b^2}}\right )}{a^2 b^2 d^3}+\frac {2 b f (e+f x) \sin (c+d x)}{a^2 d^2}+\frac {2 \left (1-\frac {b^2}{a^2}\right ) f (e+f x) \sin (c+d x)}{b d^2} \\ \end{align*}
Time = 5.90 (sec) , antiderivative size = 973, normalized size of antiderivative = 1.16 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\frac {12 \left (i d^2 e (b d e-2 a f) x-i d^2 e (b d e+2 a f) x-\frac {2 i a d^2 (e+f x)^2}{-1+e^{2 i c}}-2 d f (b d e-a f) x \log \left (1-e^{-i (c+d x)}\right )-b d^2 f^2 x^2 \log \left (1-e^{-i (c+d x)}\right )+2 d f (b d e+a f) x \log \left (1+e^{-i (c+d x)}\right )+b d^2 f^2 x^2 \log \left (1+e^{-i (c+d x)}\right )-d e (b d e-2 a f) \log \left (1-e^{i (c+d x)}\right )+d e (b d e+2 a f) \log \left (1+e^{i (c+d x)}\right )+2 i f (b d e+a f) \operatorname {PolyLog}\left (2,-e^{-i (c+d x)}\right )+2 i b d f^2 x \operatorname {PolyLog}\left (2,-e^{-i (c+d x)}\right )+2 i f (-b d e+a f) \operatorname {PolyLog}\left (2,e^{-i (c+d x)}\right )-2 i b d f^2 x \operatorname {PolyLog}\left (2,e^{-i (c+d x)}\right )+2 b f^2 \operatorname {PolyLog}\left (3,-e^{-i (c+d x)}\right )-2 b f^2 \operatorname {PolyLog}\left (3,e^{-i (c+d x)}\right )\right )-\frac {12 i \sqrt {-\left (a^2-b^2\right )^2} \left (-2 \sqrt {a^2-b^2} d f (e+f x) \operatorname {PolyLog}\left (2,\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )+2 \sqrt {a^2-b^2} d f (e+f x) \operatorname {PolyLog}\left (2,-\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )-i \left (d^2 \left (2 \sqrt {-a^2+b^2} e^2 \arctan \left (\frac {i a+b e^{i (c+d x)}}{\sqrt {a^2-b^2}}\right )+\sqrt {a^2-b^2} f x (2 e+f x) \left (\log \left (1-\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )-\log \left (1+\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )\right )\right )+2 \sqrt {a^2-b^2} f^2 \operatorname {PolyLog}\left (3,\frac {b e^{i (c+d x)}}{-i a+\sqrt {-a^2+b^2}}\right )-2 \sqrt {a^2-b^2} f^2 \operatorname {PolyLog}\left (3,-\frac {b e^{i (c+d x)}}{i a+\sqrt {-a^2+b^2}}\right )\right )\right )}{b^2}+\frac {a \csc (c) \csc (c+d x) \left (-2 a^2 d^3 x \left (3 e^2+3 e f x+f^2 x^2\right ) \cos (d x)+2 a^2 d^3 x \left (3 e^2+3 e f x+f^2 x^2\right ) \cos (2 c+d x)+3 b \left (-a \left (-2 f^2+d^2 (e+f x)^2\right ) \cos (c+2 d x)+a \left (-2 f^2+d^2 (e+f x)^2\right ) \cos (3 c+2 d x)+2 d (e+f x) \left (2 b d (e+f x) \sin (d x)+4 a f \sin (c) \sin ^2(c+d x)\right )\right )\right )}{b^2}}{12 a^2 d^3} \]
[In]
[Out]
\[\int \frac {\left (f x +e \right )^{2} \left (\cos ^{2}\left (d x +c \right )\right ) \left (\cot ^{2}\left (d x +c \right )\right )}{a +b \sin \left (d x +c \right )}d x\]
[In]
[Out]
Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 3075 vs. \(2 (753) = 1506\).
Time = 0.59 (sec) , antiderivative size = 3075, normalized size of antiderivative = 3.66 \[ \int \frac {(e+f x)^2 \cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Too large to display} \]
[In]
[Out]
\[ \int \frac {(e+f x)^2 \cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\int \frac {\left (e + f x\right )^{2} \cos ^{2}{\left (c + d x \right )} \cot ^{2}{\left (c + d x \right )}}{a + b \sin {\left (c + d x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {(e+f x)^2 \cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
Timed out. \[ \int \frac {(e+f x)^2 \cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Timed out} \]
[In]
[Out]
Timed out. \[ \int \frac {(e+f x)^2 \cos ^2(c+d x) \cot ^2(c+d x)}{a+b \sin (c+d x)} \, dx=\text {Hanged} \]
[In]
[Out]